<template>
	<view >
		<block v-for="(item,index) in list" :key="index">
					<!-- 列表样式 -->
					<common-list :item="item" :index="index" @follow='follow' @doSupport='doSupport'></common-list>
					<!-- 全局分割线 -->
								<divider></divider>
				</block>
	</view>
</template>

<script>
	import commonList from '@/components/common/common-list.vue';
	export default {
		components: {
					commonList
				},
		data() {
			return {
				list:[
									{
										username:"昵称",
										userpic:"/static/default.jpg",
										newstime:"2019-10-20 下午04:30",
										isFollow:false,
										title:"我是标题",
										titlepic:"/static/demo/datapic/11.jpg",
										support:{
											type:"support",
											support_count:1,
											unsupport_count:2
										},
										comment_count:2,
										share_num:2
									},
									{
										username:"昵称",
										userpic:"/static/default.jpg",
										newstime:"2019-10-20 下午04:30",
										isFollow:false,
										title:"我是标题",
										titlepic:"/static/demo/datapic/11.jpg",
										support:{
											type:"unsupport",
											support_count:1,
											unsupport_count:2
										},
										comment_count:2,
										share_num:2
									},
									{
										username:"昵称",
										userpic:"/static/default.jpg",
										newstime:"2019-10-20 下午04:30",
										isFollow:false,
										title:"我是标题",
										titlepic:"/static/demo/datapic/11.jpg",
										support:{
											type:"support",
											support_count:1,
											unsupport_count:2
										},
										comment_count:2,
										share_num:2
									}	
								]

			}
		},
		onLoad() {

		},
		methods: {      
			follow(e){
				this.list[e].isFollow=true;
				uni.showToast({
					title:'关注成功'
				})
			},
			doSupport(e){
				console.log(e,"111")
				this.list[e.index].support.type=e.type;
				// uni.showToast({
				// 	title:'顶一下'
				// })
			},

		}
	}
</script>

<style>

</style>
··